<?php
namespace App\Modules\Recommend;
use App\Modules\AdapterApi;
use App\Services\Recommend\RecommendIndex;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2018/6/12
 * Time: 10:10
 */
class Recommend extends AdapterApi
{
    //添加推荐位分类
    public function addRecommend(): array
    {
        $data = pick_array($this->postData, ['app_id','other_app_read','is_public','pid','name','action','profile_pic','desc','order', 'token']);
        return RecommendIndex::Recommend()->addRecommend($data);
    }

    //编辑推荐位分类
    public function editRecommend(): array
    {
        $data = pick_array($this->postData, ['id','other_app_read','is_public','pid','name','action','profile_pic','desc','order']);

        return RecommendIndex::Recommend()->editRecommend($data);
    }

    // 获取本应用下的推荐位分类树
    public function getTree(): array
    {
        $data = pick_array($this->postData, ['id','token']);

        return RecommendIndex::Recommend()->getTree($data);
    }

    /*获取某个不删除的分类详情*/
    public function oneCateInfo(): array
    {
        $data = pick_array($this->postData, ['id','token']);

        return RecommendIndex::Recommend()->oneCateInfo($data);
    }

    /*后台删除某个推荐分类*/
    public function delOneCate(): array
    {
        $data = pick_array($this->postData, ['id','token']);

        return RecommendIndex::Recommend()->delOneCate($data);
    }

}